﻿#include "OperatorsExtremum.h"

#include "GUIFrame/MainWindow.h"
#include "GUIFrame/MainTreeWidget.h"
#include "GUIWidget/TreeWidget.h"
#include "GUIDialog/ExtremumDialog.h"

#include "OperatorsInterface/GraphEventOperator.h"
#include "OperatorsInterface/ParaWidgetInterfaceOperator.h"

#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"

namespace OperModel
{
    bool OperatorsExtremum::execGUI()
    {
        GUI::MainWindow* mainWin = dynamic_cast<GUI::MainWindow*>(FITKAPP->getGlobalData()->getMainWindow());
        if (mainWin == nullptr)return false;
        GUI::TreeWidget* treeWidget = mainWin->getTreeWidget()->getTreeWidget();
        if (treeWidget == nullptr)return false;

        GUI::ExtremumDialog* dialog = new GUI::ExtremumDialog(treeWidget->getCurrentDataID(), this);
        dialog->show();
        return false;
    }

    bool OperatorsExtremum::execProfession()
    {
        return false;
    }
}

